package com.yxkj.syh.app.huarong.activities.links.detail;

import android.os.Bundle;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.syh.app.basic.base.BaseActivity;
import com.yxkj.syh.app.huarong.BR;
import com.yxkj.syh.app.huarong.R;
import com.yxkj.syh.app.huarong.constants.ArouterPath;
import com.yxkj.syh.app.huarong.databinding.ActivityLinkDetailBinding;

@Route(path = ArouterPath.LINK_DETAIL_ACTIVITY)
public class LinkDetailActivity extends BaseActivity<ActivityLinkDetailBinding, LinkDetailVM> {

    @Autowired
    long id;

    @Override
    protected int getContentLayout() {
        return R.layout.activity_link_detail;
    }

    @Override
    protected int getViewModelId() {
        return BR.linkDetailVM;
    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        mVDBinding.titleView.setLeftOnClickListener(v -> {
            finish();
        });

        mVDBinding.titleView.setRightOnClickListener(v -> {
            ARouter.getInstance().build(ArouterPath.EDIT_LINK_ACTIVITY).withLong("id", id).navigation();
        });

        mVDBinding.llPayment.setOnClickListener(v -> ARouter.getInstance().build(ArouterPath.BANK_CARDS_ACTIVITY).withLong("id",id).navigation());
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void onResume() {
        super.onResume();
        mViewModel.linkmanInfo(id);
    }
}
